-
Notifications
You must be signed in to change notification settings - Fork 125
RpcApi: add new JSON RPC API module #1583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Fabian Hartung <[email protected]> Signed-off-by: Moritz Barsnick <[email protected]> Co-authored-by: Fabian Hartung <[email protected]> Co-authored-by: Moritz Barsnick <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
…tocol_to_charge_protocol function Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
As changed in the merged PR #1319. Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Add a Findjson-rpc-cxx.cmake for non-EDM builds. The target_include_directories() directive needs to be different for EDM and non-EDM (Yocto) builds for the header-only json-rpc-cxx. Also remove json-rpc-cxx from target_link_libraries(), as it is header-only. Signed-off-by: Moritz Barsnick <[email protected]>
…figuration from YAML files Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Introduce a little bit more consistency. Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Only listen on all interfaces if explicitly asked via config "all". Do not accept an empty string. Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
… flag EVSE index 0 is reserved for the charger itself and should not be used to set/clear the EVSE error present flag. In the future, we might want to introduce a charger error present flag. Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
This takes applicable values from DIN 70121 and ISO 15118-2 ev_info, and maps them to the display parameters originally meant for ISO 15118-20. Most notably, the EV's SoC - also determined by "AC with SoC" - is now exported to the API. Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
The API modules don't work well without. RpcApi could partially work around this, but it's not worth the effort right now. Signed-off-by: Moritz Barsnick <[email protected]>
This leads to proper constification. (Noticed by cppcheck.) Also constify an EVSEInfoStore method to now properly satisfy the const requirement. Signed-off-by: Moritz Barsnick <[email protected]>
(Noticed by cppcheck, but mostly cosmetic, not performance relevant.) Signed-off-by: Moritz Barsnick <[email protected]>
(Suggested by cppcheck.) Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Lambda templates are only supported starting with C++20.
Fixes
modules/API/RpcApi/rpc/RpcHandler.cpp: In lambda function:
modules/API/RpcApi/rpc/RpcHandler.cpp:75:26: warning: lambda templates are only available with ‘-std=c++20’ or ‘-std=gnu++20’ [-Wpedantic]
75 | auto result = [&]<std::size_t... I>(std::index_sequence<I...>) {
| ^
Signed-off-by: Moritz Barsnick <[email protected]>
Triggered with `-Wextra`. Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
df6a0f0 to
143545b
Compare
Signed-off-by: Moritz Barsnick <[email protected]>
|
@Pietfried regarding comment #1324 (comment): All other previous comments have been addressed. I have no idea why the Actions/CI is consistently stuck today though. |
The EnergyNode for EVSE#1 was not chained between grid and EvseManager. Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
All members of DisplayParametersObj are optional. So if we did not assign anything at all, pass a std::nullopt, to keep the object empty/missing. Signed-off-by: Moritz Barsnick <[email protected]>
This was previously used for generation of the C++ types, but removed in favor of everest_api. Bring this definition back as a reference, for use with a future everest_api compatible code generator. Signed-off-by: Moritz Barsnick <[email protected]>
This prepares for managing the RpcApi types within the module, not in everest_api, and not via the types/ infastructure. This reverts commits 8fd3d1a, 4f84d31, 421cbb0. Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
This avoids passing the test with a randomly uninitialized variable. Signed-off-by: Moritz Barsnick <[email protected]>
The module was using the interface types infrastructure for creating its external types C++ representations. This is not desired. Move the generated code into the module, and preserve the types YAML to make use of the generation logic for future changes. Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
This amends and fixes "RpcApi: move types to module". Signed-off-by: Moritz Barsnick <[email protected]>
The generated source does not conform to clang-format formatting. Signed-off-by: Moritz Barsnick <[email protected]>
Describe your changes
This introduces a new API module RpcApi, which uses JSON RPC, and WebSockets as a transport layer.
It uses both RPC Methods and Notifications.
This is the implementation according to the proposal with was discussed here on Zulip and documented here. The original proposal was slightly modified, as several details proved inconsistent, impractical, or just mis-specified.
Documentation of the current state of implementation is included in the module's
docs/subdirectory. The current (or the final merged) state will be manifested as API version 1.0.0. Future updates to the external API definition will require API version bumps.A Python GUI test client is included under
modules/API/RpcApi/tools/python-client-gui/.Not implemented in the current state of the API:
This will be added later, with corresponding bumps of the API version (where applicable).
A non-squashed version of this work is found in the branch feature/json-rpc-api-nosquash, for reference regarding small change steps, commit messages with motivations, and so on.
Co-authored-by: Fabian Hartung [email protected]
Co-authored-by: Moritz Barsnick [email protected]
Issue ticket number and link
This is a new request after incorrect closure of #1324.
Checklist before requesting a review